<template>
  <div class="main">
    <el-container class="main-content">
      <el-aside :width="isCollapse ? '60px' : '210px'" class="main-aside">
        <nav-menu :Collapse="isCollapse"></nav-menu>
      </el-aside>
      <el-container class="page">
        <el-header class="page-header">
          <nav-header @foldChange="foldChange" />
        </el-header>
        <el-main class="page-main"><router-view /></el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import { ElContainer, ElHeader, ElMain } from 'element-plus'
import navMenu from '../../components/nav-menu/index'
import navHeader from '../../components/navHeader/index'
export default defineComponent({
  components: {
    ElContainer,
    ElHeader,
    ElMain,
    navMenu,
    navHeader
  },
  setup() {
    const isCollapse = ref(false)
    const foldChange = (isfold: boolean) => {
      isCollapse.value = isfold
    }

    return {
      foldChange,
      isCollapse
    }
  }
})
</script>

<style scoped lang="less">
.main {
  width: 100%;
  height: 100%;
}
.main-content {
  width: 100%;
  height: 100%;
  background: rgb(255, 127, 80);
}
.main-aside {
  background-color: rgb(20, 20, 20);
  transition: width 0.3s linear;
}
.page-header {
  height: 45px;
  background-color: rgb(247, 252, 247);
}
.page-main {
  background-color: #f5f5f5;
  font-weight: bold;
}
</style>
